LinSpace ================= 生成从 ``start`` 到 ``end`` 的等间距序列,线性插值 .. math:: \text{output}_i = \text{start} + i \cdot \frac{\text{end} - \text{start}}{\text{length} - 1},\quad i = 0, 1, \dots, \text{length} - 1 输入: - **start** - 序列起始值。 - **end** - 序列终止值(包含)。 - **length** - 序列点数;要求 length ≥ 2。 - **core_mask(可选)** - 核掩码(仅适用于共享存储版本)。 输出: - **output** - 输出序列地址(float32)。 支持平台: ``FT78NE`` ``MT7004`` .. note:: - 多核版本按行数均匀分割,各核处理自己的段落。 - 步长计算为 (end - start) / (length - 1)。 **共享存储版本:** .. c:function:: void fp_linspace_s(float *output, float start, float end, int length, int core_mask) **C调用示例:** .. code-block:: c :linenos: :emphasize-lines: 10 #include int main(int argc, char* argv[]) { float *output = (float *)0xA0000000; // DDR float start = 0.0f; float end = 100.0f; int length = 1001; int core_mask = 0xff; fp_linspace_s(output, start, end, length, core_mask); return 0; } **私有存储版本:** .. c:function:: void fp_linspace_p(float *output, float start, float step, int num) **C调用示例:** .. code-block:: c :linenos: :emphasize-lines: 9 #include int main(int argc, char* argv[]) { float *output = (float *)0x10000000; // L2 float start = 1.5f; float step = 0.5f; int num = 1000; fp_linspace_p(output, start, step, num); return 0; }